<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("title", "普天永利—让创业更简单");
%>
<%@ include file="/WEB-INF/views/shared/master/weContentHeader.jsp"%>

<style type="text/css">
.swiper-slide>img {
	width: 100%;
}

.swiper-pagination-bullet-active {
	background-color: white;
}

.type-item img {
	width: 45px;
	height: 45px;
}

.type-item {
	cursor: pointer;
}

.type-item .title {
	font-size: 13px;
	color: #4c4c4c;
}

.titlehidden {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	overflow: hidden;
}

.titlehidden2 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.fistTitle {
	width: 5rem;
	padding: 0.5rem;
	color: white;
	font-size: 17px;
	line-height: 1.5rem;
}

.showDetial {
	margin: 0.5rem;
	padding: 0.3rem;
	color: #ffffff;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 0.2rem;
	font-size: 13px;
}

.weui-media-box_appmsg .weui-media-box__hd {
	width: 80px;
	height: 80px;
}

.cashbox {
	background-color: white;
	position: relative;
}

.cashbottom {
	position: absolute;
	top: 15px;
	right: 0px;
	padding: 0.2rem 0.5rem;
	background-color: #ff5B4b;
	background: #ff7225 none repeat scroll !important;
}

.tab-container {
	border-top: 1px solid #e5e5e5;
	border-bottom: 1px solid #e5e5e5;
	padding-top: 0.7rem !important;
	padding-bottom: 0.7rem !important;
}

.tab li {
	width: 10%;
}

.showInsu>li {
	
}

.showInsu li img {
	width: 100%;
	height: 100%;
	border-left: 1px solid #e5e5e5;
}

#roll {
	height: 22px;
	overflow: hidden;
}
/* 底部栏 */
.weui-tabbar {
	position: fixed !important;
	background-color: #fff;
	padding-top: 5px;
}

.weui-tabbar__icon {
	width: 20px;
	height: 20px;
}

.weui-tabbar__item.weui-bar__item--on .weui-tabbar__label {
	color: #1fa0db;
}
.tittleIcon{
	padding-top: 10px;
}
.tittleIcon>.weui-flex__item{
text-align: center;
}
.title1{
	color: #ffffff;
	margin-top: -8px;
	font-size: 0.6rem;
	
}
.tittleImg{
	width: 20px !important;
	height: 20px !important;
}
.weui-badge{
	padding: 0px;
	position: absolute;
	top:0.2em;
	right: 0.6rem;
	display: inline-block;
	width: 0.8rem;
	height: 0.8rem;
	line-height:0.8rem;
	border-radius: 50%;
	font-size: 0.3rem;	
}
</style>

<input type="hidden" id="customerId" value="${customer.id}"/>
<input type="hidden" id="taskToGuide" value="${taskToGuide}"/>

<!-- 底部活动引导 -->
	<%-- <div class="guide weui-tabbar" style="background: rgba(0, 0, 0, 0.6);margin-bottom: 50px;">
		<a id="taskHref" class="weui-cell" style="padding: 0px 15px 5px 15px;width: 100%" href="">
			<div class="weui-cell__hd">
				<img style="width: 20px;height: 20px;" class="icon_img" src="<c:url value='/images/we/index/icon_horn.png' />">
			</div>
			<div class="weui-cell__bd" id="taskContant" style="color: #ffffff;font-size: 0.6rem;letter-spacing:2px;">
				签到啦!签到啦!签到送金豆,你还在等什么..
			</div>
			<div class="weui-cell__ft">
				<div style="border: 1px solid #ffffff;border-radius:10px;color: #ffffff;padding: 3px 10px 0px 10px;font-size: 0.6rem">
					去完成
				</div>
			</div>
		</a>
	</div> --%>

<div style="position: relative;">

<div class="weui-tab">
	<div class="weui-tab__bd">
		
		<div class="swiper-container" style="position: relative;">
			<div class="swiper-wrapper">
				<div class="swiper-slide">
					<img src="<c:url value='/images/we/index/111.png' />" alt="">
				</div>
				<a class="swiper-slide" href="<c:url value='/wechat/cust/customerIden/joinEntrepreneur'/>">				
					<img src="<c:url value='/images/we/index/222.jpg' />" alt="">					
				</a>
			</div>
			<div class="swiper-pagination" style="text-align: center;"></div>
			
			<!-- 顶部三个图标 -->
			<%-- <div class="weui-flex tittleIcon" style="position: absolute;top:0px;left:0px;z-index: 501;width: 100%">
				<div class="weui-flex__item type-item">				
					<a href="<c:url value='/wechat/acc/myWealth/myWealth'/>"> 
						<img class="tittleImg" alt="" src="<c:url value='/images/we/index/icon_Tmoney.png' />">
						<div class="title1">财富</div>
					</a>
				</div>
				<div class="weui-flex__item type-item" style="flex:6">
					<a href="<c:url value='/wechat/cust/invitation/posterIndex'/>"> 
						<div class="title1"></div>
					</a>
				</div>
				<div class="weui-flex__item type-item" style="float: right;">
					<a href="<c:url value='/wechat/onlineSer/onlineSer/onlineSer' />"> 
						<img class="tittleImg"  alt="" src="<c:url value='/images/we/index/icon_TcustSer.png' />">
						<div class="title1">客服</div>
					</a>
				</div>

				<div class="weui-flex__item type-item" style="padding-right: 10px;">
					<span class="weui-badge" style="">180</span>
					<a href="#"> 
						<img class="tittleImg" alt="" src="<c:url value='/images/we/index/icon_Tmsg.png' />">
						<div class="title1">消息</div>
					</a>
				</div>
			</div> --%>
		</div>

		<div style="text-align: center; margin-top: 0.5rem;">
			<div class="weui-flex">
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/cust/invitation/posterIndex'/>"> <img alt=""
						src="<c:url value='/images/we/index/icon_tool.jpg' />">
						<div class="title">营销工具</div>
					</a>
				</div>
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/cust/invitation/invitationIndex'/>"> <img alt="" src="<c:url value='/images/we/index/icon_share.jpg' />">
						<div class="title">推荐有奖</div>
					</a>
				</div>
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/acti/activity' />"> <img alt=""
						src="<c:url value='/images/we/index/icon_active.jpg' />">
						<div class="title">最新活动</div>
					</a>
				</div>
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/active/sign/sign' />"> <img
						alt="" src="<c:url value='/images/we/index/icon_sign.png' />">
						<div class="title">签到</div>
					</a>
				</div>
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/share/cloudClass'/>"> <img
						alt="" src="<c:url value='/images/we/index/icon_cloud.png' />" />
						<div class="title">云课堂</div>
					</a>
				</div>
			</div>
			<div class="weui-flex" style="margin-top: 0.5rem;">
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/zzb/carInsu'/>"> <img alt=""
						src="<c:url value='/images/we/index/icon_car.png' />">
						<div class="title">车险</div>
					</a>
				</div>
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/insu/insuranceClassify/showInsu'/>">
						<img alt="" src="<c:url value='/images/we/index/icon_acc.png' />" />
						<div class="title">意外/健康险</div>
					</a>
				</div>
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/onlineSer/onlineSer/onlineSer' />">
						<img alt="" src="<c:url value='/images/we/index/icon_peo.jpg' />">
						<div class="title">在线客服</div>
					</a>
				</div>
				<div class="weui-flex__item type-item">
					<a href="<c:url value='/wechat/cust/personCenter/index' />"> <img
						alt="" src="<c:url value='/images/we/index/icon_center.png' />">
						<div class="title">会员中心</div>
					</a>
				</div>
				<div class="weui-flex__item type-item">
					<a href="#"> <img alt=""
						src="<c:url value='/images/we/index/icon_more.jpg' />">
						<div class="title">敬请期待</div>
					</a>
				</div>
			</div>
		</div>

		<div class="weui-cells">
			<div class="weui-cell">
				<div class="weui-cell__hd" style="color: #1fa0db; font-size: 17px;">资讯</div>
				<div class="weui-cell__bd" id="roll" style="padding-left: 20px">
				<c:forEach items="${articals}" var="artical">
					<div style="margin-top: 8px">
						<input type="hidden"  class="articalId" value="${artical.id}" />
						<input type="hidden"  class="medioType" value="${artical.medioType}" />
						<p class="titlehidden" style="font-size: 16px;color: #333333;margin:0rem 0.5rem">【云课堂】${artical.title}</p>
					</div>
				</c:forEach>
				</div>

				<a href="<c:url value='/wechat/share/information?picture=right&name=shareInformation'/>">
					<div class="weui-cell__ft"
						style="color: #999999; font-size: 15px; border-left: 1px solid #dbdbdb; padding-left: 0.5rem">更多</div>
				</a>
			</div>
		</div>
		<div style="width: 100%; height: 10px; background-color: #f5f5f5;"></div>



<div>
	<p style="font-size: 17px;color: #333333;margin:15px; ">精选产品</p>
	<div style="display: flex;">
		<a href="<c:url value='/wechat/insu/insuranceClassify/insuranceWechatDetail?insuranceId=${chooseProduct1.id}'/>" style="flex-grow:1;flex-basis: 0%;background-image: url('<c:url value='${tfn:getFileUrl(chooseProduct1.addImg) }' />');background-size:100% 100%;height: 12.3rem;margin-left:15px;margin-right:0.3rem">
			<p class="titlehidden2 fistTitle" style="">${chooseProduct1.insuranceName }</p>
			<span class="showDetial">查看详情</span>
		</a>
		<div style="flex-grow:1;flex-basis: 0%;height: 12rem;margin-right:15px ">
			<a href="<c:url value='/wechat/insu/insuranceClassify/insuranceWechatDetail?insuranceId=${chooseProduct2.id}'/>">
				<div style="background-image: url('<c:url value='${tfn:getFileUrl(chooseProduct2.addImg) }' />');background-size:100% 100%;height: 5.3rem;"> 
				<span class="titlehidden2 fistTitle">${chooseProduct2.insuranceName }</span>
				<span class="showDetial">查看详情</span>
				</div>
			</a>
			<div style="display: flex;margin-top: 0.3rem">
				<a href="<c:url value='/wechat/insu/insuranceClassify/insuranceWechatDetail?insuranceId=${chooseProduct3.id}'/>" style="flex-grow:9;flex-basis: 0%;background-image: url('<c:url value='${tfn:getFileUrl(chooseProduct3.addImg) }' />');background-size:100% 100%;height: 6.7rem;margin-right: 0.3rem">
					<span class="titlehidden2 fistTitle" style="width:3rem;font-size:15px ">${chooseProduct3.insuranceName }</span>
					<span class="showDetial" style="font-size: 10px">查看详情</span>
				</a>
				<a href="<c:url value='/wechat/insu/insuranceClassify/insuranceWechatDetail?insuranceId=${chooseProduct4.id}'/>" style="flex-grow:8;flex-basis: 0%;background-image: url('<c:url value='${tfn:getFileUrl(chooseProduct4.addImg) }' />');background-size:100% 100%;height: 6.7rem;text-align: center;">			
					<span class="titlehidden2 fistTitle" style="width:2rem;font-size:15px ">${chooseProduct4.insuranceName }</span>
					<span class="showDetial" style="font-size: 10px;">查看详情</span>
				</a>	
			</div>
		</div>
	</div>
</div>

		<div style="width: 100%; height: 10px; background-color: #f5f5f5;"></div>

		<div class="weui-panel weui-panel_access">
			<div class="weui-panel__hd" style="font-size: 17px; color: #333333;">热卖产品</div>
			<div class="weui-panel__bd">
				<c:forEach items="${insurances}" var="insurance">
					<a
						href="<c:url value='/wechat/insu/insuranceClassify/insuranceWechatDetail?insuranceId=${insurance.id}'/>"
						class="weui-media-box weui-media-box_appmsg cashbox">
						<div class="weui-media-box__hd">
							<img class="weui-media-box__thumb"
								src="${tfn:getFileUrl(insurance.mainImg)}">
						</div>
						<div class="weui-media-box__bd">
							<h4 class="weui-media-box__title" style="width: 8rem">${insurance.insuranceName}</h4>
							<p class="weui-media-box__desc" style="width: 10rem;">${insurance.insuranceContent}</p>
							<div class="weui-flex" style="margin-top: 0.2rem">
								<div class="weui-flex__item"
									style="flex-grow: 6; margin-top: 0.2rem">
									<span
										style="float: left; vertical-align: middle; font-size: 13px; color: #999"><span
										style="color: #e1361a; font-size: 16px; font-weight: bold;">￥${insurance.minPremium}</span>&nbsp;&nbsp;起</span>
								</div>
								<div class="weui-flex__item"
									style="flex-grow: 1; justify-content: center;">
									<img alt="" src="${tfn:getFileUrl(insurance.logoUrl)}"
										style="width: 3rem; vertical-align: middle; height: 0.8rem">
								</div>
							</div>
						</div> <c:if
							test="${customer.level=='maker'||customer.level=='highMaker'}">
							<div class="cashbottom"
								style="border-bottom-left-radius: 0.3rem; border-top-left-radius: 0.3rem">
								<span style="color: white; font-size: 0.6rem; float: left;"
									class="levelHide"> 奖励<fmt:formatNumber type="percent"
										minFractionDigits="0"
										value=" ${insurance.shareProportionOne} " /> + <fmt:formatNumber
										type="percent" minFractionDigits="0"
										value=" ${insurance.shareProportionOne/3-0.005} " />
								</span>
							</div>
						</c:if>
					</a>
				</c:forEach>
			</div>
		</div>

		<div>
			<p style="font-size: 17px; color: #333333; margin: 15px;">合作平台</p>
			<div class="tab-container" data-id="claim-container" id="claim-tab">
				<ul class="tab tab-horizontal showInsu" style="width: auto"
					id="first-menu">
					<li><img
						src="<c:url value='/images/we/index/insu_zgpa.png' />"></li>
					<li><img
						src="<c:url value='/images/we/index/insu_zgrs.png' />"></li>
					<li><img src="<c:url value='/images/we/index/insu_33.jpg' />">
					</li>
					<li><img src="<c:url value='/images/we/index/insu_44.png' />">
					</li>
					<li><img src="<c:url value='/images/we/index/insu_66.png' />">
					</li>
					<li><img
						src="<c:url value='/images/we/index/insu_hzrs.png' />"></li>
					<li><img
						src="<c:url value='/images/we/index/insu_tabx.png' />"></li>
					<li><img
						src="<c:url value='/images/we/index/insu_tkrs.png' />"></li>
					<li><img
						src="<c:url value='/images/we/index/insu_tpybx.png' />"></li>
					<li><img
						src="<c:url value='/images/we/index/insu_zgdd.png' />"></li>
				</ul>
			</div>
		</div>
		<div style="width: 100%; height: 10px; background-color: #f5f5f5;"></div>

		<div style="height: 2rem;"></div>
	</div>

	<div class="weui-tabbar">
		<a href="<c:url value='/wechat/home/index' />"
			class="weui-tabbar__item weui-bar__item--on">
			<div class="weui-tabbar__icon">
				<img src="<c:url value='/images/we/index/icon_home0.png' />" alt="">
			</div>
			<p class="weui-tabbar__label">首页</p>
		</a> <a href="<c:url value='/wechat/insu/insuranceClassify/showInsu'/>"
			class="weui-tabbar__item">
			<div class="weui-tabbar__icon">
				<img src="<c:url value='/images/we/index/icon_insu0.png' />" alt="">
			</div>
			<p class="weui-tabbar__label">产品</p>
		</a> <a href="<c:url value='/wechat/share/cloudClass'/>"
			class="weui-tabbar__item">
			<div class="weui-tabbar__icon"
				style="height: 15px; margin-bottom: 2px; margin-top: 2px;">
				<img src="<c:url value='/images/we/index/icon_share1.png' />" alt="">
			</div>
			<p class="weui-tabbar__label">创业</p>
		</a> <a href="<c:url value='/wechat/cust/personCenter/index' />"
			class="weui-tabbar__item">
			<div class="weui-tabbar__icon">
				<img src="<c:url value='/images/we/index/icon_per1.png' />" alt="">
			</div>
			<p class="weui-tabbar__label">我的</p>
		</a>
	</div>
</div>

<!-- 活动遮罩层 -->
	<%-- <div class="showActivity" style="background: rgba(0, 0, 0, 0.3); position: absolute; top: 0px; left: 0px; text-align: center; z-index:501" hidden>
		<a href="<c:url value='/wechat/acti/activity' />">
			<img style='width: 240px; height: 360px;margin-top: 3rem' src='<c:url value='/images/we/index/active1.png' />'>
		</a>
		<div style="text-align: center;margin-top: -7px" onclick="closeActive()">
			<img style='width: 30px;height: 70px;' src='<c:url value='/images/we/index/active2.png' />'>
		</div>
	</div> --%>

</div>


<%@ include file="/WEB-INF/views/shared/scripts/jquery.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/jqweui.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/swiper.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/tabmob.jsp"%>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">

/* 底部引导跳转路径 */
/* var hrefSign = $.getVirtualPath() + "/wechat/active/sign/sign";
var hrefShare =$.getVirtualPath() + "/wechat/share/informationDetail?id=02ea846b-6d51-43cb-a7a0-dba372140af1";
var hrefComment = $.getVirtualPath() + "/wechat/share/informationDetail?id=02ea846b-6d51-43cb-a7a0-dba372140af1";
var hrefMaker = $.getVirtualPath() + "/wechat/cust/invitation/posterIndex";
var hrefTask = $.getVirtualPath() + "/wechat/acti/activity"; */


	$(function() {
		
		//活动广告遮罩层
		/* $(".showActivity").width(window.screen.availWidth);
		$(".showActivity").height(window.screen.availHeight);				
		showActive(); */
		
		//底部活动引导
		/* var $taskToGuide = $("#taskToGuide").val();
		if($taskToGuide=="sign"){
			$("#taskHref").attr("href",hrefSign);
			$("#taskContant").html("签到啦!签到啦!签到送金豆,你还在等什么..");
		}
		else if($taskToGuide=="share"){
			$("#taskHref").attr("href",hrefShare);
			$("#taskContant").html("分享咨询..");
		}
		else if($taskToGuide=="comment"){
			$("#taskHref").attr("href",hrefComment);
			$("#taskContant").html("评论咨询..");
		}
		else if($taskToGuide=="maker"){
			$("#taskHref").attr("href",hrefMaker);
			$("#taskContant").html("分享海报,招募创客,海量金豆等你拿~~");
		}else{
			$("#taskHref").attr("href",hrefTask);
			$("#taskContant").html("完成任务，赢取金豆~~");
		} */
		
		$(".swiper-container").swiper({
			pagination : '.swiper-pagination',
			paginationClickable : true,
			autoplay : 3000
		});
		movedown();
		shareStore();
	})
//微信分享	
	function shareStore() {

		var url = $.getVirtualPath() + "/wechat/cust/personCenter/shareSignature";
		var linkHref=location.href.split('#')[0];
		var href=encodeURIComponent(linkHref);
		var resultJson = $.getJsonPost(url, "href=" + href);

		var config = {
			debug : false,
			appId : resultJson.jsapiSignature.appId,// 公众号的唯一标识
			timestamp : resultJson.jsapiSignature.timestamp,// 生成签名的时间戳
			nonceStr : resultJson.jsapiSignature.nonceStr,// 生成签名的随机串
			signature : resultJson.jsapiSignature.signature,// 签名
			jsApiList : [ 'onMenuShareAppMessage', 'onMenuShareTimeline' ]
		}
		wx.config(config);

		// 微信事件
		wx.ready(function() {
			// 分享朋友
			wx.onMenuShareAppMessage({
				title : '永利共享商城',
				desc : '生活消费一站购，推荐赚钱尽情享',
				link : linkHref,
				imgUrl : 'http://www.putiyoli.net/ares/images/logo.png',
				success : function() {
					console.log(arguments);
				},
				error : function() {
				}
			});

			wx.onMenuShareTimeline({
				title : '生活消费一站购，推荐赚钱尽情享',
				link : linkHref,
				imgUrl : 'http://www.putiyoli.net/ares/images/logo.png',
				success : function(res) {
				}
			});

			// 微笑错误处理机制
			wx.error(function(res) {
				console.log(res.errMsg);
			});
		});
	}
//云课堂轮播
	function movedown() {
		var marginTop = 8;
		var stop = false;
		var interval = setInterval(function() {
			if (stop)
				return;
			$('#roll').children('div').first().animate({
				'margin-top' : marginTop--
			}, 8, function() {
				var $first = $(this);
				if (!$first.is(':animated')) {
					if ((-marginTop) > $first.height()) {
						$first.css({
							'margin-top' : 8
						}).appendTo($('#roll'));
						marginTop = 8;
					}
				}
			});
		}, 100);
		toArticalDetailed();
	}
	
	function toArticalDetailed(){
		$(".titlehidden").click(function(){
			var id = $(this).parent().find(".articalId").val();
			var medioType = $(this).parent().find(".medioType").val();
			if(medioType === 'artical'){
				window.location.href=$.getVirtualPath() + "/wechat/share/informationDetail?id="+id;
			}else if(medioType === 'video'){
				window.location.href=$.getVirtualPath() + "/wechat/share/videoDetail?id="+id;
			}
			
		})
	}
	
//显示活动遮罩层
	/* function showActive() {
		var id = $("#customerId").val();		
		//openDatabase方法打开已经存在的数据库，如果不存在将会创建一个数据库
        var db = window.openDatabase("mydatabase", "1.0", "我的数据库", 20000);       
                    
        //创建数据表
        var sql = "CREATE TABLE  if not exists indexTable (id REAL UNIQUE)";
        db.transaction(function (tx) {
            tx.executeSql(sql,
            []);
        });

        //查数据
       db.transaction(function (tx) {
           tx.executeSql("select * from indexTable where id= ?", 
           [id],
           function(tx,result){ 
        	   if(result.rows.length==1){
        		   $(".showActivity").hide();
        	   }
			   if(result.rows.length==0){
				   $(".showActivity").show();
				   db.transaction(function (tx) {
			            tx.executeSql("INSERT INTO indexTable (id) values(?)", 
			            [id],
			            function(tx,result){ }, 
			        	function(tx, error){ });
			        });
        	   }
           }, 
       	   function(tx, error){});
       });
	} */
//隐藏活动遮罩层
	/* function closeActive() {
		$(".showActivity").hide();
	} */
</script>

<%@ include file="/WEB-INF/views/shared/master/weContentFooter.jsp"%>
